package com.gujiangbo.slot;

import io.lettuce.core.cluster.SlotHash;
import io.lettuce.core.codec.CRC16;
import org.junit.jupiter.api.Test;

import java.nio.ByteBuffer;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2022/5/13 16:38
 * @Version: 1.0
 * @Description:
 */
public class HashSlotTest {

    @Test
    public void testSlot(){
        System.out.println(SlotHash.getSlot("user1_cat"));

        System.out.println(CRC16.crc16(ByteBuffer.wrap("user1_cat".getBytes())) % 16384);
    }
}
